Detecting potential class loader problems using the class search path sequence for each class loader

ABSTRACT

A method, system and computer program product for identifying potential class loader problems prior to or during the deployment of the classes to the production environment. A set of class loaders is loaded into memory. The set of class loaders is arranged hierarchically into parent-child relationships. The class search path sequence for each class loader in the hierarchy is generated to detect and identify potential class loader problems. Those class loaders with a duplicate class in its class search path sequence are identified as those class loaders that may pose a potential problem. A message may then be displayed to the user identifying these class loaders as posing a potential problem. By identifying these class loaders prior to or during the deployment of the classes to the production environment, class loader problems may be prevented from occurring.

TECHNICAL FIELD

The present invention relates generally to class loaders, and moreparticularly to detecting potential class loader problems using theclass search path sequence for each class loader in a set of classloaders arranged hierarchically into parent-child relationships.

BACKGROUND

A class loader, such as a Java® class loader, dynamically loads classesinto a virtual machine. Usually, these classes are only loaded on demandas discussed below.

A software library is a collection of related object code. In the Java®language, libraries are typically packaged in JAR (Java® ARchive) files.Libraries can contain objects of different types. The most importanttype of object contained in a JAR file is a Java® class. A class can bethought of as a named unit of code. The class loader is responsible forlocating libraries, reading their contents, and loading the classescontained within the libraries. This loading is typically done “ondemand,” in that it does not occur until the class is actually used bythe program. A class with a given name can only be loaded once by agiven class loader.

Unfortunately, problems may occur when the class loader loads theclasses, such as class cast exceptions (indicates that the code hasattempted to cast an object to a subclass of which it is not aninstance), class not found exceptions (e.g., class is not visible on thelogical classpath of the context class loader, the applicationincorrectly uses a class loader API, a dependent class is not visible),no class definition found exceptions (e.g., class is not in the logicalclass path, class cannot load), etc.

Currently, when a class loader problem occurs, traces, logs or memorydumps are analyzed to determine the causes of the class loader errors.However, such analysis occurs after the classes have been deployed tothe production environment involving time consuming analysis to debugthese problems, especially in large and complex product enterpriseenvironments. If, however, potential class loader problems could beidentified or detected prior to or during the deployment of the classesto the production environment, then class loader errors could beeliminated (e.g., eliminate a class cast exception error) thereby savingprogrammers time from no longer having to debug class loader problems.

Unfortunately, there is not currently a means for identifying ordetecting potential class loader problems prior to or during thedeployment of the classes to the production environment.

SUMMARY

In one embodiment of the present invention, a method for identifyingpotential class loader problems comprises loading a set of class loadersinto memory. The method further comprises arranging the set of classloaders hierarchically into parent-child relationships. The methodadditionally comprises generating, by a processor, a class search pathsequence for each class loader. Furthermore, the method comprisesidentifying one or more class loaders with a duplicate class in itsclass search path sequence. In addition, the method comprises displayinga message identifying the identified one or more class loaders as beingpotentially problematic.

Other forms of the embodiment of the method described above are in asystem and in a computer program product.

The foregoing has outlined rather generally the features and technicaladvantages of one or more embodiments of the present invention in orderthat the detailed description of the present invention that follows maybe better understood. Additional features and advantages of the presentinvention will be described hereinafter which may form the subject ofthe claims of the present invention.

BRIEF DESCRIPTION OF THE DRAWINGS

A better understanding of the present invention can be obtained when thefollowing detailed description is considered in conjunction with thefollowing drawings, in which:

FIG. 1 illustrates a hardware configuration of a computer systemconfigured in accordance with an embodiment of the present invention;

FIG. 2 is a flowchart of a method for identifying potential class loaderproblems prior to or during the deployment of the classes to theproduction environment in accordance with an embodiment of the presentinvention;

FIG. 3 illustrates a hierarchical arrangement of the class loaders inparent-child relationships in accordance with an embodiment of thepresent invention;

FIG. 4 is a flowchart of an algorithm implementing the sub-steps ofsteps 203-205 of the method of FIG. 2 in accordance with an embodimentof the present invention; and

FIG. 5 illustrates the class search path sequence for each class loaderin the hierarchical arrangement of FIG. 4 in accordance with anembodiment of the present invention.

DETAILED DESCRIPTION

The present invention comprises a method, system and computer programproduct for identifying potential class loader problems prior to orduring the deployment of the classes to the production environment. Inone embodiment of the present invention, a set of class loaders isloaded into memory. The set of class loaders is arranged hierarchicallyinto parent-child relationships. The class search path sequence for eachclass loader in the hierarchy is generated to detect and identifypotential class loader problems. Those class loaders with a duplicateclass in its class search path sequence are identified as those classloaders that may pose a potential problem. Those class loaders havingthe first class in the duplicate class recited in its class search pathsequence being one of the class loader's classes may be identified ascausing more of a potential problem than those class loaders having thefirst class in the duplicate class recited in its class search pathsequence not being one of the class loader's classes. A message may thenbe displayed to the user identifying these class loaders as posing apotential problem. By identifying these class loaders prior to or duringthe deployment of the classes to the production environment, classloader problems may be prevented from occurring.

In the following description, numerous specific details are set forth toprovide a thorough understanding of the present invention. However, itwill be apparent to those skilled in the art that the present inventionmay be practiced without such specific details. In other instances,well-known circuits have been shown in block diagram form in order notto obscure the present invention in unnecessary detail. For the mostpart, details considering timing considerations and the like have beenomitted inasmuch as such details are not necessary to obtain a completeunderstanding of the present invention and are within the skills ofpersons of ordinary skill in the relevant art.

Referring now to the Figures in detail, FIG. 1 illustrates a hardwareconfiguration of a computer system 100 which is representative of ahardware environment for practicing the present invention. Computersystem 100 has a processor 101 coupled to various other components bysystem bus 102. An operating system 103 runs on processor 101 andprovides control and coordinates the functions of the various componentsof FIG. 1. An application 104 in accordance with the principles of thepresent invention runs in conjunction with operating system 103 andprovides calls to operating system 103 where the calls implement thevarious functions or services to be performed by application 104.Application 104 may include, for example, a program for identifyingpotential class loader problems prior to or during the deployment of theclasses to the production environment as discussed further below inassociation with FIGS. 2-5.

Referring again to FIG. 1, read-only memory (“ROM”) 105 is coupled tosystem bus 102 and includes a basic input/output system (“BIOS”) thatcontrols certain basic functions of computer system 100. Random accessmemory (“RAM”) 106 and disk adapter 107 are also coupled to system bus102. It should be noted that software components including operatingsystem 103 and application 104 may be loaded into RAM 106, which may becomputer system's 100 main memory for execution. Disk adapter 107 may bean integrated drive electronics (“IDE”) adapter that communicates with adisk unit 108, e.g., disk drive. It is noted that the program foridentifying potential class loader problems prior to or during thedeployment of the classes to the production environment, as discussedfurther below in association with FIGS. 2-5, may reside in disk unit 108or in application 104.

Computer system 100 may further include a communications adapter 109coupled to bus 102. Communications adapter 109 interconnects bus 102with an outside network thereby enabling computer system 100 tocommunicate with other such systems.

I/O devices may also be connected to computer system 100 via a userinterface adapter 110 and a display adapter 111. Keyboard 112, mouse 113and speaker 114 may all be interconnected to bus 102 through userinterface adapter 110. A display monitor 115 may be connected to systembus 102 by display adapter 111. In this manner, a user is capable ofinputting to computer system 100 through keyboard 112 or mouse 113 andreceiving output from computer system 100 via display 115 or speaker114.

The present invention may be a system, a method, and/or a computerprogram product. The computer program product may include a computerreadable storage medium (or media) having computer readable programinstructions thereon for causing a processor to carry out aspects of thepresent invention.

The computer readable storage medium can be a tangible device that canretain and store instructions for use by an instruction executiondevice. The computer readable storage medium may be, for example, but isnot limited to, an electronic storage device, a magnetic storage device,an optical storage device, an electromagnetic storage device, asemiconductor storage device, or any suitable combination of theforegoing. A non-exhaustive list of more specific examples of thecomputer readable storage medium includes the following: a portablecomputer diskette, a hard disk, a random access memory (RAM), aread-only memory (ROM), an erasable programmable read-only memory (EPROMor Flash memory), a static random access memory (SRAM), a portablecompact disc read-only memory (CD-ROM), a digital versatile disk (DVD),a memory stick, a floppy disk, a mechanically encoded device such aspunch-cards or raised structures in a groove having instructionsrecorded thereon, and any suitable combination of the foregoing. Acomputer readable storage medium, as used herein, is not to be construedas being transitory signals per se, such as radio waves or other freelypropagating electromagnetic waves, electromagnetic waves propagatingthrough a waveguide or other transmission media (e.g., light pulsespassing through a fiber-optic cable), or electrical signals transmittedthrough a wire.

Computer readable program instructions described herein can bedownloaded to respective computing/processing devices from a computerreadable storage medium or to an external computer or external storagedevice via a network, for example, the Internet, a local area network, awide area network and/or a wireless network. The network may comprisecopper transmission cables, optical transmission fibers, wirelesstransmission, routers, firewalls, switches, gateway computers and/oredge servers. A network adapter card or network interface in eachcomputing/processing device receives computer readable programinstructions from the network and forwards the computer readable programinstructions for storage in a computer readable storage medium withinthe respective computing/processing device.

Computer readable program instructions for carrying out operations ofthe present invention may be assembler instructions,instruction-set-architecture (ISA) instructions, machine instructions,machine dependent instructions, microcode, firmware instructions,state-setting data, or either source code or object code written in anycombination of one or more programming languages, including an objectoriented programming language such as Smalltalk, C++ or the like, andconventional procedural programming languages, such as the “C”programming language or similar programming languages. The computerreadable program instructions may execute entirely on the user'scomputer, partly on the user's computer, as a stand-alone softwarepackage, partly on the user's computer and partly on a remote computeror entirely on the remote computer or server. In the latter scenario,the remote computer may be connected to the user's computer through anytype of network, including a local area network (LAN) or a wide areanetwork (WAN), or the connection may be made to an external computer(for example, through the Internet using an Internet Service Provider).In some embodiments, electronic circuitry including, for example,programmable logic circuitry, field-programmable gate arrays (FPGA), orprogrammable logic arrays (PLA) may execute the computer readableprogram instructions by utilizing state information of the computerreadable program instructions to personalize the electronic circuitry,in order to perform aspects of the present invention.

Aspects of the present invention are described herein with reference toflowchart illustrations and/or block diagrams of methods, apparatus(systems), and computer program products according to embodiments of theinvention. It will be understood that each block of the flowchartillustrations and/or block diagrams, and combinations of blocks in theflowchart illustrations and/or block diagrams, can be implemented bycomputer readable program instructions.

These computer readable program instructions may be provided to aprocessor of a general purpose computer, special purpose computer, orother programmable data processing apparatus to produce a machine, suchthat the instructions, which execute via the processor of the computeror other programmable data processing apparatus, create means forimplementing the functions/acts specified in the flowchart and/or blockdiagram block or blocks. These computer readable program instructionsmay also be stored in a computer readable storage medium that can directa computer, a programmable data processing apparatus, and/or otherdevices to function in a particular manner, such that the computerreadable storage medium having instructions stored therein comprises anarticle of manufacture including instructions which implement aspects ofthe function/act specified in the flowchart and/or block diagram blockor blocks.

The computer readable program instructions may also be loaded onto acomputer, other programmable data processing apparatus, or other deviceto cause a series of operational steps to be performed on the computer,other programmable apparatus or other device to produce a computerimplemented process, such that the instructions which execute on thecomputer, other programmable apparatus, or other device implement thefunctions/acts specified in the flowchart and/or block diagram block orblocks.

The flowchart and block diagrams in the Figures illustrate thearchitecture, functionality, and operation of possible implementationsof systems, methods, and computer program products according to variousembodiments of the present invention. In this regard, each block in theflowchart or block diagrams may represent a module, segment, or portionof instructions, which comprises one or more executable instructions forimplementing the specified logical function(s). In some alternativeimplementations, the functions noted in the block may occur out of theorder noted in the figures. For example, two blocks shown in successionmay, in fact, be executed substantially concurrently, or the blocks maysometimes be executed in the reverse order, depending upon thefunctionality involved. It will also be noted that each block of theblock diagrams and/or flowchart illustration, and combinations of blocksin the block diagrams and/or flowchart illustration, can be implementedby special purpose hardware-based systems that perform the specifiedfunctions or acts or carry out combinations of special purpose hardwareand computer instructions.

As stated in the Background section, problems may occur when the classloader loads the classes, such as class cast exceptions (indicates thatthe code has attempted to cast an object to a subclass of which it isnot an instance), class not found exceptions (e.g., class is not visibleon the logical classpath of the context class loader, the applicationincorrectly uses a class loader API, a dependent class is not visible),no class definition found exceptions (e.g., class is not in the logicalclass path, class cannot load), etc. Currently, when a class loaderproblem occurs, traces, logs or memory dumps are analyzed to determinethe causes of the class loader errors. However, such analysis occursafter the classes have been deployed to the production environmentinvolving time consuming analysis to debug these problems, especially inlarge and complex product enterprise environments. If, however,potential class loader problems could be identified or detected prior toor during the deployment of the classes to the production environment,then class loader errors could be eliminated (e.g., eliminate a classcast exception error) thereby saving programmers time from no longerhaving to debug class loader problems. Unfortunately, there is notcurrently a means for identifying or detecting potential class loaderproblems prior to or during the deployment of the classes to theproduction environment.

The principles of the present invention provide a means for identifyingor detecting potential class loader problems prior to or during thedeployment of the classes to the production environment by utilizing theclass search path sequence for each class loader in a set of classloaders arranged hierarchically into parent-child relationships asdiscussed further below in connection with FIGS. 2-5. FIG. 2 is aflowchart of a method for identifying potential class loader problemsprior to or during the deployment of the classes to the productionenvironment. FIG. 3 illustrates a hierarchical arrangement of the classloaders in parent-child relationships. FIG. 4 is a flowchart of analgorithm implementing the sub-steps of steps 203-205 of the method ofFIG. 2. FIG. 5 illustrates the class search path sequence for each classloader in the hierarchical arrangement of FIG. 4.

As stated above, FIG. 2 is a flowchart of a method 200 for identifyingpotential class loader problems prior to or during the deployment of theclasses to the production environment in accordance with an embodimentof the present invention.

Referring to FIG. 2, in conjunction with FIG. 1, in step 201, a set ofclass loaders is loaded into memory, such as memory 106.

In step 202, the set of class loaders is arranged hierarchically intoparent-child relationships as illustrated in FIG. 3. FIG. 3 illustratesa hierarchical arrangement 300 of the class loaders in parent-childrelationships in accordance with an embodiment of the present invention.

Referring to FIG. 3, FIG. 3 illustrates hierarchical arrangement 300 ofthe class loaders utilizing a parent-delegation model. The delegationmodel requires that any request for a class loader to load a given classis first delegated to its parent class loader before the requested classloader tries to load the class itself. The parent class loader, in turn,goes throughout the same process of asking its parent. This chain ofdelegation continues through to the bootstrap or root class loader (alsoknown as the primordial or system class loader). If a class loader'sparent cannot load a given class, it returns that class. Otherwise, theclass loader attempts to load the class itself.

As illustrated in FIG. 3, at the top of hierarchy 300 is the root orprimordial class loader 301A. Class loader 301A has two children classloaders 301B, 301C. Class loader 301B has two child class loaders 301D,301E, whereas, class loader 301C has a single child class loader 301F.As further illustrated in FIG. 3, class loader 301D has a single childclass loader 301G and class loader 301F has a single child class loader301H. Class loaders 301A-301H may collectively or individually bereferred to as class loaders 301 or class loader 301, respectively. FIG.3 is not to be limited in scope to any particular number of child classloaders 301. Each class loader 301 in hierarchical arrangement 300 ofthe class loaders may have zero or more child class loaders 301.

Furthermore, as illustrated in FIG. 3, each class loader 301 includesone or more loaded classes in the class loader. For example, root classloader 301A has class K and class L. Class loader 301B contains classesD, E and F. Class loader 301C contains classes M, N and O. Furthermore,class loader 301D contains classes A, B and F. Class loader 301Econtains classes G, H, I and K. Class loader 301F contains classes P andQ. Additionally, class loader 301G contains classes M and F.Furthermore, class loader 301H contains classes R and L.

As further illustrated in FIG. 3, each class loader 301 is designatedwith either a parent-first or a parent-last delegation mode. Such adesignation will be used to determine whether to append the classloader's parent node's class search path sequence before or after theclass loader's classes as discussed in further detail below inconnection with FIG. 5. A class search path sequence refers to the pathused by a virtual machine or compiler to locate these classes.

Returning now to FIG. 2, in conjunction with FIGS. 1 and 3, in step 203,the class search path sequence for each class loader 301 in hierarchy300 is generated to detect and identify potential class loader problems.A further description of the steps involved in generating the classsearch path sequence will be provided below in connection with FIG. 4.

In step 204, the class loaders with a duplicate class in its classsearch path sequence are identified. As will be discussed further below,those class loaders that contain a duplicate class in its class searchpath sequence may pose a potential problem. By incorporating thealgorithm of the present invention to identify such class loaders duringcompile time or build time in a development environment (e.g., testsystem), those class loaders that are potentially problematic (i.e.,those class loaders that have may have a problem loading the classesresulting in class cast exceptions, class not found exceptions, no classdefinition found exceptions, etc.) can be identified prior to or duringthe deployment of the classes thereby preventing the problems fromoccurring. A further description of the steps involves in identifyingthe class loaders with a duplicate class in the class search pathsequence will be provided below in connection with FIG. 4.

In step 205, a message is displayed identifying the identified classloaders as being potentially problematic. A further description of thesteps involves in displaying a message identifying the identified classloaders as being potentially problematic will be provided below inconnection with FIG. 4.

Referring now to FIG. 4, FIG. 4 is a flowchart of an algorithm 400 forimplementing the sub-steps of steps 203-205 of method 200 of FIG. 2 inaccordance with an embodiment of the present invention.

Referring to FIG. 4, in conjunction with FIGS. 1-3, in step 401, thecurrent class loader 301 is pushed to a stack. In one embodiment,hierarchical arrangement 300 of the class loaders as shown in FIG. 3 isimplemented by a stack.

In step 402, a determination is made as to whether the stack is empty.If the stack is empty, then, in step 403, the process is completed forgenerating the class search path sequence for each class loader.

If, however, the stack is not empty, then, in step 404, a class loaderis popped from the stack.

In step 405, a determination is made as to whether the delegation modeof the class loader is parent-first. If the delegation mode of the classloader is parent-first, then, in step 406, a class search path sequenceis composed by prefixing the parent node's class search path.

If, however, the delegation mode of the class loader is not parent-first(i.e., parent-last), then, in step 407, a class search path sequence iscomposed by postfixing the parent node's class search path.

An illustration of composing the class search path sequence based on thedelegation mode is shown in FIG. 5.

FIG. 5 illustrates the class search path sequence for each class loader301 in hierarchical arrangement 300 of FIG. 3 utilizing algorithm 400 inaccordance with an embodiment of the present invention.

Referring to FIG. 5, in conjunction with FIGS. 1-4, since class loader301B has a delegation mode of parent-first, the class search pathsequence for class loader 301B is composed by prefixing its parentnode's class search path (the class search path of class loader 301A) tothe class loader's classes thereby forming the class search pathsequence of KL DEF.

In another example, class loader 301C has a delegation mode ofparent-last. As a result, the class search path sequence for classloader 301C is composed by postfixing its parent node's class searchpath (the class search path of class loader 301A) to the class loader'sclasses thereby forming the class search path sequence of MNO KL.

Similarly, class loader 301D has a delegation mode of parent-first. As aresult, the class search path sequence for class loader 301D is composedby prefixing its parent node's class search path (the class search pathof class loader 301B) to the class loader's classes thereby forming theclass search path sequence of KL DEF ABF.

In a further example, class loader 301E has a delegation mode ofparent-last. As a result, the class search path sequence for classloader 301E is composed by postfixing its parent node's class searchpath (the class search path of class loader 301B) to the class loader'sclasses thereby forming the class search path sequence of GHIK KL DEF.

In another example, class loader 301F has a delegation mode ofparent-first. As a result, the class search path sequence for classloader 301F is composed by prefixing its parent node's class search path(the class search path of class loader 301C) to the class loader'sclasses thereby forming the class search path sequence of MNO KL PQ.

Similarly, class loader 301G has a delegation mode of parent-last. As aresult, the class search path sequence for class loader 301G is composedby postfixing its parent node's class search path (the class search pathof class loader 301D) to the class loader's classes thereby forming theclass search path sequence of MF KL DEF ABF.

In a further example, class loader 301H has a delegation mode ofparent-last. As a result, the class search path sequence for classloader 301H is composed by postfixing its parent node's class searchpath (the class search path of class loader 301F) to the class loader'sclasses thereby forming the class search path sequence of RL MNO KL PQ.

Returning now to FIG. 4, in conjunction with FIGS. 1-3 and 5, in step408, a determination is made as to whether there is a duplicate class inthe class search path sequence.

If there is a duplicate class in the class search path sequence, then,in step 409, a determination is made as whether the first class in theduplicate class recited in the class search path sequence is one of theclass loader's classes.

If the first class in the duplicate class recited in the class searchpath sequence is not one of the class loader's classes, then, in step410, the class loader is marked with a “warning” as being a potentialproblem. In step 411, a message is displayed to the user (i.e., user ofcomputer system 100) identifying the class loader as being marked with a“warning.”

If, however, the first class in the duplicate class recited in the classsearch path sequence is one of the class loader's classes, then, in step412, the class loader is marked as “suspect” as being a potentialproblem. In step 413, a message is displayed to the user (i.e., user ofcomputer system 100) identifying the class loader as being marked as“suspect.”

As used herein, the designation of “warning” is an indication of alesser potential problem then the designation of “suspect.” That is, thedesignation of “warning” corresponds to one level of severity of apotential problem and the designation of “suspect” corresponds toanother level of severity of a potential problem. The designation of“suspect” has a higher level of severity of a potential problem than thedesignation of “warning.”

For example, as illustrated in FIG. 5, class loaders 301D, 301E, 301Gand 301H each have a duplicate class in its class search path sequence.With respect to class loader 301D, the first class F of the duplicateclass F recited in the class search path sequence for class loader 301Dis not found in the classes of class loader 301D. Instead, the firstclass F of the duplicate class F recited in the class search pathsequence for class loader 301D is found in its parent's class loader. Asa result, there is less of a potential class loader problem (e.g., classcast exceptions, class not found exceptions, no class definition foundexceptions, etc.) than the alternative of having the first class of theduplicate class recited in the class search path sequence of classloader 301 being one of the classes of class loader 301 as is the casewith class loaders 301E, 301G and 301H. In such a scenario, class loader301 is marked with a “warning” 501 as shown in FIG. 5.

As further shown in FIG. 5, with respect to class loader 301E, the firstclass K of the duplicate class K recited in the class search pathsequence for class loader 301E is found in the classes of class loader301E. Similarly, with respect to class loader 301G, the first class F ofthe duplicate class F recited in the class search path sequence forclass loader 301G is found in the classes of class loader 301G. Inanother example, with respect to class loader 301H, the first class L ofthe duplicate class L recited in the class search path sequence forclass loader 301H is found in the classes of class loader 301H. When thefirst class of the duplicate class recited in the class search pathsequence for class loader 301 is found in class loader's 301 classes,there is a greater potential for a class loader problem (e.g., classcast exceptions, class not found exceptions, no class definition foundexceptions, etc.) than the alternative of having the first class of theduplicate class recited in the class search path sequence of classloader 301 not being one of the classes of class loader 301. In such ascenario, class loader 301 is marked with the designation of “suspect”502A-502C as shown in FIG. 5 for class loaders 301E, 301G and 301H,respectively. While the foregoing discusses designating class loaders301 with the designation of “warning” or “suspect,” the principles ofthe present invention are not to be limited to such designations. Theprinciples of the present invention include any designation that is usedto signify different levels of severity in potential class loaderproblems.

By utilizing the class search path sequence for each class loader 301 toidentify those class loaders 301 with a class search path sequence thatcontains a duplicate class, class loaders 301 that may pose a potentialproblem can be identified. By implementing such an algorithm to identifysuch class loaders during compile time or build time in a developmentenvironment (e.g., test system), those class loaders that arepotentially problematic (i.e., those class loaders that have may have aproblem loading the classes resulting in class cast exceptions, classnot found exceptions, no class definition found exceptions, etc.) can beidentified prior to or during the deployment of the classes therebypreventing the problems from occurring.

Returning to step 408 of FIG. 4, in conjunction with FIGS. 1-3 and 5, ifthere is not a duplicate class in the class search path sequence, orupon displaying a message identifying class loader 301 as being markedwith a “warning” or as “suspect” in steps 411 and 413, respectively,then, in step 414, a determination is made as to whether class loader301 has any children.

If class loader 301 does not have any children, then a determination ismade as to whether the stack is empty in step 402.

If, however, class loader 301 has children, then, in step 415, thechildren are pushed to the stack.

Code written in the Java® programming language for implementingalgorithm 400 is shown below.

procedure detectSuspectClassLoader(ClassLoader node):    Stack stack =new Stack    stack.push(node)    while not stack.isEmpty( ){       node= stack.pop( )       if(node.isParentFirst( )){        node.setSearchPathSequence(node. getParentSearchPath()+node.getClasses( ))       } else {        node.setSearchPathSequence(node.getClasses( ) +node.getParentSearchPathSequence( ))       }      if(node.getParentSearchPathSequence( ).contains(node. getClasses())){         node.setWarning(true)         for each duplicate class {          if(node.getClasses( ).contains(first duplicate class)){             node.setSuspect(true)           }         }       }      if(node.hasChildren( ){         for each node.child{          stack.push(node.child)         }       }    }

As discussed above, algorithm 400 may be implemented during compile timeor build time in a development environment (e.g., test system) to detectpossible class loader problems before production deployment. In thismanner, those class loaders that are potentially problematic (i.e.,those class loaders that have may have a problem loading the classesresulting in class cast exceptions, class not found exceptions, no classdefinition found exceptions, etc.) can be identified prior to or duringthe deployment of the classes thereby preventing the problems fromoccurring.

The descriptions of the various embodiments of the present inventionhave been presented for purposes of illustration, but are not intendedto be exhaustive or limited to the embodiments disclosed. Manymodifications and variations will be apparent to those of ordinary skillin the art without departing from the scope and spirit of the describedembodiments. The terminology used herein was chosen to best explain theprinciples of the embodiments, the practical application or technicalimprovement over technologies found in the marketplace, or to enableothers of ordinary skill in the art to understand the embodimentsdisclosed herein.

The invention claimed is:
 1. A method for identifying potential classloader problems, the method comprising: loading a set of class loadersinto memory; arranging said set of class loaders hierarchically intoparent-child relationships; generating, by a processor, a class searchpath sequence for each class loader in said set of class loaders todetect and identify potential class loader problems; identifying one ormore class loaders in said set of class loaders with a duplicate classin its class search path sequence; marking a first class loader with afirst level of severity of a potential problem in response to detectinga first class in a duplicate class recited in a class search pathsequence of said first class loader that is not one of one or moreclasses of said first class loader; marking a second class loader with asecond level of severity of a potential problem in response to detectinga first class in a duplicate class recited in a class search pathsequence of said second class loader that is one of one or more classesof said second class loader; and displaying a message identifying saididentified one or more class loaders as being potentially problematicduring compile time or build time prior to or during deployment ofclasses thereby preventing problems from occurring.
 2. The method asrecited in claim 1 further comprising: composing said class search pathsequence for a class loader by prefixing a parent node's class searchpath to one or more classes of said class loader in response to saidclass loader having a delegation mode of parent-first.
 3. The method asrecited in claim 1 further comprising: composing said class search pathsequence for a class loader by postfixing a parent node's class searchpath to one or more classes of said class loader in response to a classloader having a delegation mode of parent-last.
 4. The method as recitedin claim 1, wherein said hierarchical arrangement is implemented by astack.
 5. The method as recited in claim 1, wherein said class searchpath sequence for each class loader is generated during one of thefollowing: a compile time in a development environment and a build timein said development environment.
 6. The method as recited in claim 5,wherein said development environment is a test system.
 7. The method asrecited in claim 1, wherein said first class in said duplicate classrecited in said class search path sequence of said first class loader isfound in a parent class loader of said first class loader.
 8. The methodas recited in claim 1, wherein said second level of severity of saidpotential problem is a higher level of severity of a potential problemthan said first level of severity of said potential problem.